USE SAS
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'GetProductsPrices')
	BEGIN
		DROP  Procedure  dbo.GetProductsPrices
	END

GO

CREATE Procedure dbo.GetProductsPrices
AS
BEGIN

	SELECT 
		p.ProductNo					AS [Product No]
	,	p.ProductDesc				AS [Description]
	,	p.UnitPrice					AS [Unit Price]
	,	(CASE WHEN ISNULL(p.isActive,0) = 1 THEN 'Yes' ELSE 'No' END)		AS [Active]
	,	p.ProductID					AS [PKID]
	FROM TR_PRODUCT p
	ORDER BY p.isActive DESC, ProductDesc ASC

END
GO